/*
 * @Author: zhouwr 1551541860@qq.com
 * @Date: 2024-02-21 16:16:41
 * @LastEditors: zhouwr 1551541860@qq.com
 * @LastEditTime: 2024-02-27 23:20:30
 * @FilePath: /jeecgboot-vue3/src/views/activiti/procdef/components/actProcessDefConfig/activity/ConfigActivity.data.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { BasicColumn, FormSchema } from '/@/components/Table'

export const columns: BasicColumn[] = [
  {
    title: '节点编码',
    dataIndex: 'id',
    key: 'id',
  },
  {
    title: '节点名称',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: 'PC表单地址',
    dataIndex: 'pcComponentPath',
    key: 'pcComponentPath',
  },
  {
    title: '移动表单地址',
    key: 'mobileComponentPath',
    dataIndex: 'mobileComponentPath',
  },
]

//自定义表单字段
export const formSchemas: FormSchema[] = [
  {
    label: '节点Id',
    field: 'id',
    component: 'Input',
    rules: [{ required: true, message: '请输入节点id' }],
  },
  {
    label: '节点名称',
    field: 'name',
    component: 'Input',
    rules: [{ required: true, message: '请输入节点名称' }],
  },
  {
    label: 'PC表单地址',
    field: 'pcComponentPath',
    component: 'Input',
  },
  {
    label: 'PC表单地址',
    field: 'mobileComponentPath',
    component: 'Input',
  },
]

export const activityOptionFormData = {
  isFormEditable: 0,
  isSelectProcessors: 1,
  isTaskCC: 1,
  isReject: 1,
  isForward: 1,
  fixedProcessors: '',
  isBeforeApostille: 1,
  isAfterApostille: 1,
  isCommentRequired: 0,
}

/**
 * 任务节点操作配置项
 */
export const activityOptionFormSchemas: FormSchema[] = [
  {
    label: '表单可编辑',
    field: 'isFormEditable',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      //选中时的值
      checkedValue: 1,
    },
  },
  {
    label: '选择下一步处理人',
    field: 'isSelectProcessors',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      checkedValue: 1,
    },
  },
  {
    label: '任务可抄送',
    field: 'isTaskCC',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      checkedValue: 1,
    },
  },
  {
    label: '任务可驳回',
    field: 'isReject',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      checkedValue: 1,
    },
  },
  {
    label: '任务可转发',
    field: 'isForward',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      //选中时的值
      checkedValue: 1,
      dynamicDisabled: (a) => {
        console.log(a);
        return true
      }
    },
  },
  {
    label: '固定处理人',
    field: 'fixedProcessors',
    component: 'JSelectUser',
    helpMessage: ['设置固定处理人后，该任务节点不可选择处理人、不可转发'],
    componentProps: {
      labelKey: 'realname',
      rowKey: 'id',
      showSelected: true
    }
  }, {
    label: '任务前加签',
    field: 'isBeforeApostille',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      checkedValue: 1,
    },
  }, {
    label: '任务后加签',
    field: 'isAfterApostille',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      checkedValue: 1,
    },
  }, {
    label: '任务处理意见必填',
    field: 'isCommentRequired',
    component: 'Switch',
    componentProps: {
      //开关大小，可选值：default small
      size: 'small',
      //非选中时的值
      unCheckedValue: 0,
      checkedValue: 1,
    },
  },


]
